package com.atguigu.lease.web.admin.custom.config.SpringMvcConfig;

import com.atguigu.lease.web.admin.custom.config.StringToBaseEnumConverterFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class BaseConverterMvc implements WebMvcConfigurer {

    @Autowired
    private StringToBaseEnumConverterFactory stringToEnumConfig;

    @Override
    public void addFormatters(FormatterRegistry registry) {
        registry.addConverterFactory(stringToEnumConfig);//添加转换器工厂
    }
}
